package github.aloofcoder.gulimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import github.aloofcoder.common.utils.PageUtils;
import github.aloofcoder.gulimall.product.entity.AttrEntity;
import github.aloofcoder.gulimall.product.vo.AttrGroupRelationVo;
import github.aloofcoder.gulimall.product.vo.AttrRespVo;
import github.aloofcoder.gulimall.product.vo.AttrVo;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author hanle
 * @email hanl1946@163.com
 * @date 2020-12-03 22:29:55
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveAttr(AttrVo attr);

    PageUtils queryBaseAttrList(Long catelogId, Map<String, Object> params, String type);

    AttrRespVo getAttrInfo(Long attrId);

    void updateAttr(AttrVo attr);

    /**
     * 根据分组Id查找关联的所有属性
     * @param attrgroupId
     * @return
     */
    List<AttrEntity> getRelationAttr(Long attrgroupId);

    void deleteRelation(List<AttrGroupRelationVo> asList);

    PageUtils getNoRelationAttr(Long attrgroupId, Map<String, Object> params);

    List<Long> selectSearchAttrs(List<Long> attrIds);
}

